<span page-title ng-model="host">{{ 'Module Streams for: ' | translate }} {{ host.name }}</span>
<div bst-feature-flag="remote_actions">
  <h3 translate ng-hide="selectedModuleStreamOption === 'available'">Available Module Streams</h3>
</div>

<div ng-hide="host.hasContent()">
  <div data-extend-template="common/views/registration.html"></div>
</div>

<div ng-if="host && host.hasContent()">

  <form id="moduleStreamActionForm" method="post" action="/katello/remote_execution">
    <input type="hidden" name="remote_action" ng-value="moduleStreamActionFormValues.remoteAction"/>
    <input type="hidden" name="module_stream_action" ng-value="moduleStreamActionFormValues.moduleStreamAction"/>
    <input type="hidden" name="module_spec" ng-value="moduleStreamActionFormValues.moduleSpec"/>
    <input type="hidden" name="bulk_host_ids" ng-value="moduleStreamActionFormValues.hostHostIds"/>
    <input type="hidden" name="customize" ng-value="moduleStreamActionFormValues.customize"/>
    <input type="hidden" name="authenticity_token" ng-value="moduleStreamActionFormValues.authenticityToken"/>
  </form>

  <div data-extend-template="layouts/partials/table.html">
    <span data-block="filters">
      <div class="kat-clearfix">
        <div class="kat-inline">
          <label translate>Filter by Status: </label>
        </div>
        <div class="kat-inline">
          <select ng-model="nutupaneParams.status">
            <option value="">All</option>
            <option value="enabled" translate>Enabled</option>
            <option value="installed" translate>Installed</option>
            <option value="disabled" translate>Disabled</option>
            <option value="unknown" translate>Unknown</option>
            <option value="upgradable" translate>Upgrade Available</option>
          </select>
        </div>
      </div>
    </span>

    <span data-block="no-rows-message" translate>
      There are no Module Streams to display.
    </span>

    <span data-block="no-search-results-message" translate>
      Your search returned zero Module Streams.
    </span>
    <div data-block="table">
      <table class="table table-striped table-bordered" ng-class="{'table-mask': table.working}">
        <thead>
          <tr bst-table-head>
            <th bst-table-column translate>Name</th>
            <th bst-table-column translate>Stream</th>
            <th bst-table-column translate>Status</th>
            <th bst-table-column translate>Installed Profile</th>
            <th bst-table-column translate>Actions</th>
          </tr>
        </thead>

        <tbody>
          <tr bst-table-row ng-repeat="module in table.rows">
            <td bst-table-cell>
              <a href="/module_streams?search=module_spec%3D{{ module.module_spec }}+and+host%3D{{ host.name }}">
              {{ module.name }}</a></td>
            <td bst-table-cell>{{ module.stream }}</td>
            <td bst-table-cell>
              {{ moduleStreamStatus(module) }}
              <span ng-if="module.upgradable" class="pficon pficon-info"
                    uib-tooltip="{{ 'Upgrade Available' | translate }}"
              > </span>
            </td>
            <td bst-table-cell>
              {{ module.installed_profiles.join(", ") }}
            </td>
            <td bst-table-cell>
              <div class="dropdown" ng-hide="!remoteExecutionPresent || denied('edit_hosts', host)">
                <button class="btn btn-default dropdown-toggle" ng-disabled="$scope.working" type="button" id="dropdownMenu1" data-toggle="dropdown"> Actions
                  <span class="caret"></span>
                </button>
                <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
                  <li role="presentation">
                    <label class="drop-down-check-box">
                      <input id="customize" name="customize" ng-model="moduleStreamActionFormValues.customize" type="checkbox"/>
                      <span translate>Customize</span>
                    </label>
                  </li>
                  <li role="presentation" class="divider"></li>

                  <li role="presentation" ng-repeat="action in moduleStreamActions"><a role="menuitem" tabindex="-1" ng-click="performViaRemoteExecution(module.module_spec, action.action)" href="#">{{ action.description}}</a></li>
                </ul>
              </div>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
  </div>
</div>
